﻿using AbpApplication.AppServices;
using AbpApplication.InPut;
using Hangfire;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Identity.Client;

namespace AbpWebapi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class BaseServiceController : ControllerBase
    {

        private readonly IBaseService _baseService;
        private readonly IEssService _esService;

        public BaseServiceController(IBaseService baseService, IEssService esService)
        {
            _baseService = baseService;
            _esService = esService;
        }
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Create_Boxs(InPut_BaseService input)=>await _baseService.Create_Boxs(input);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Update_Box(InPut_BaseService2 input)=>await _baseService.Update_Box(input);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Create_Warehouses(InPut_BaseService3 input) => await _baseService.Create_Warehouses(input);
        [HttpPost]
        public async Task <ApiResponse> test() => await _baseService.test();     
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Update_WarehouseLines(InPut_BaseService5 inPut)=>await _baseService.Update_WarehouseLines(inPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CreateMaterialBase(InPut_BaseService7 inPut)=>await _baseService.CreateMaterialBase(inPut);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> CreateNeetOutMaterial(InPut_BaseService10 InPut) => await _baseService.CreateNeetOutMaterial(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Create_Inlethouses(InPut_BaseService9 input) => await _baseService.Create_Inlethouses(input);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> Create_Inlethouse(InPut_BaseService9 input) => await _baseService.Create_Inlethouse(input);
        [HttpPost]
        [Authorize(Roles = "管理员")]
        public async Task<ApiResponse> GetList_InlethouesCode(string Type)=>await _baseService.GetList_InlethouesCode(Type);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateTaskOrderState(InPut_BaseService11 InPut)=>await _baseService.UpdateTaskOrderState(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> DeleteTaskOrder(List<string> TaskOrderCodes)=>await _baseService.DeleteTaskOrder(TaskOrderCodes); 
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CreateLog(InPut_BaseService15 InPut)=>await _baseService.CreateLog(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> DeleteBox(InPut_BaseService8 InPut)=>await _baseService.DeleteBox(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> DeleteMaterial(InPut_BaseService4 input)=>await _baseService.DeleteMaterial(input);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CreateTaskOrder(InPut_BaseService6 InPut)=>await _baseService.CreateTaskOrder(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> RemovesMaterial(List<string> MaterialCodes)=>await _baseService.RemovesMaterial(MaterialCodes);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CreateTaskOrderOut(InPut_BaseService13 InPut)=>await _baseService.CreateTaskOrderOut(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateMaterialBaserQuantity(InPut_BaseService7 inPut) => await _baseService.UpdateMaterialBaserQuantity( inPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CreateMaterialProperty(InPut_BaseService14 InPut)=>await _baseService.CreateMaterialProperty(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Create_Bintype(InPut_BaseService16 InPut)=>await _baseService.Create_Bintype(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Getlist_Bintypes()=>await _baseService.Getlist_Bintypes();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateState_ByWarehouselineId(InPut_BaseService17 InPut) => await _baseService.UpdateState_ByWarehouselineId(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateState_ByInlethouselineId(InPut_BaseService18 InPut) => await _baseService.UpdateState_ByInlethouselineId(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateNeetQuantity(InPut_BaseService19 InPut)=>await _baseService.UpdateNeetQuantity(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public  async Task<ApiResponse> AllocationOrder(InPut_BaseService20 InPut)=>await _baseService.AllocationOrder(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Deallocate(string Symbol)=>await _baseService.Deallocate(Symbol);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> AllocationOrderAgvTask(InPut_BaseService21 InPut) => await _baseService.AllocationOrderAgvTask(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public  async Task<ApiResponse> Create_SowingWall(InPut_BaseService22 InPut)=>await _baseService.Create_SowingWall(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Update_SowingWall(string SowingWallLine_Name)=>await _baseService.Update_SowingWall(SowingWallLine_Name);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Polling_OutBound()=>await _baseService.Polling_OutBound();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Polling_TaskOrder()=>await _baseService.Polling_TaskOrder();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Polling_TaskAgv_OutBound() => await _baseService.Polling_TaskAgv_OutBound();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> moveContainer_wms(InPut_EssService5 InPut)=>await _baseService.moveContainer_wms(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> DeleteMoveContainer(string boxCode)=>await _baseService.DeleteMoveContainer(boxCode);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> SendCustomerOutRep(string Consumer_MaterialId) =>await _baseService.SendCustomerOutRep(Consumer_MaterialId);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Manual_FinishOrder(Guid PutOutOrder_id)=>await _baseService.Manual_FinishOrder(PutOutOrder_id);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse>  UpdatManualQuantity(InPut_BaseService24 InPut)=>await _baseService.UpdatManualQuantity(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateMaterialQuantity(InPut_BaseService25 InPut) => await _baseService.UpdateMaterialQuantity( InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CheckBoxMaterial(string BoxPosition) => await _baseService.CheckBoxMaterial( BoxPosition);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Start_StockTaking(InPut_BaseService26 InPut)=>await _baseService.Start_StockTaking(InPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> CheckView_Box_Warehoueline(IFormFile excelStream) => await _baseService.CheckView_Box_Warehoueline(excelStream);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> GetOrderNo(string BoxCode) => await _baseService.GetOrderNo(BoxCode);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> LocationCheck()=>await _baseService.LocationCheck();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> SingleOutbount(Guid guid)=> await _baseService.SingleOutbount(guid);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> UpdateBoxMaterial(InPut_BaseService7 inPut)=> await _baseService.UpdateBoxMaterial(inPut);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> DeleteCustomCheckList(List<Guid> guid)=>await _baseService.DeleteCustomCheckList(guid);
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> Polling_UpdateQuantity()=> await _baseService.Polling_UpdateQuantity();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async  Task<ApiResponse> Polling_ClearConveyorline()=>await _baseService.Polling_ClearConveyorline();
        [HttpPost]
        public async Task<ApiResponse> Polling_expireTaskOrder()=> await _baseService.Polling_expireTaskOrder();
        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> IsReplenishment()=>await _baseService.IsReplenishment();

        [HttpPost]
        [Authorize(Roles = "管理员,员工")]
        public async Task<ApiResponse> GetConveyorline() => await _baseService.GetConveyorline();

    }
}
